﻿@if (Model != null && Model.Banners != null)
{
    <div class="carousel slide  hidden-xs" id="myCarousel">
        <ol class="carousel-indicators">
            @for (int i = 0; i < Model.Banners.Count; i++)
            {
                if (i == 0)
                {
                    <li data-slide-to="@i" data-target="#myCarousel" class="active"> </li>
                }
                else
                {
                    <li data-slide-to="@i" data-target="#myCarousel"> </li>
                }
            }
        </ol>
        <div class="carousel-inner">
            @for (int i = 0; i < Model.Banners.Count; i++)
            {
                if (i == 0)
                {
                    <div class="item active">
                        <img src="@Model.Banners[i].ImgUrl" alt="@Model.Banners[i].ImgUrl">
                    </div>
                }
                else
                {
                    <div class="item">
                        <img src="@Model.Banners[i].ImgUrl" alt="@Model.Banners[i].ImgUrl">
                    </div>
                }
            }
        </div>
        <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
            <span class="glyphicon glyphicon-chevron-right"></span>
            <span class="sr-only">Next</span>
        </a>
    </div>
}